package org.karson.designpattern.behavioral.memento.text;

import java.util.Stack;

/**
 * @author Karson Wang
 * @title SnapshotHolder
 * @Description 描述
 * @Date 2020/4/16 19:51
 * @Copyright 2019-2020
 */
public class SnapshotHolder {

    private Stack<Snapshot> snapshots = new Stack<>();

    public Snapshot popSnapshot() {
        return snapshots.pop();
    }

    public void pushSnapshot(Snapshot snapshot) {
        snapshots.push(snapshot);
    }
}
